package com.thermal.thermal_inspection.service.impl;

import com.thermal.thermal_inspection.mapper.ResultMapper;
import com.thermal.thermal_inspection.service.ResultService;
import com.thermal.thermal_inspection.entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ResultServiceImpl implements ResultService {

    @Autowired
    private ResultMapper resultMapper;

    @Override
    public Result getById(Integer id) {
        return resultMapper.selectById(id);
    }

    @Override
    public List<Result> getAll() {
        return resultMapper.selectAll();
    }

    @Override
    public int add(Result result) {
        return resultMapper.insertResult(result);
    }

    @Override
    public int update(Result result) {
        return resultMapper.updateResult(result);
    }

    @Override
    public int delete(Integer id) {
        return resultMapper.deleteById(id);
    }
    // ResultServiceImpl.java

    @Override
    public List<Result> searchResults(String patientName, String doctorName, String diagnosisType) {
        return resultMapper.searchResults(patientName, doctorName, diagnosisType);
    }

}

